//
//  CYLRightImageButton.m
//  CollectionViewClassifyMenu

static float const kImageToTextMargin = 7;

#import "CYLRightImageButton.h"

@implementation CYLRightImageButton

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self = [self sharedInit];
    }
    return self;
}
- (id)initWithCoder: (NSCoder *)aDecoder {
    self = [super initWithCoder: aDecoder];
    if (self) {
        self = [self sharedInit];
    }
    return self;
}
- (id)sharedInit {
    
    [self setTitle:@"" forState:UIControlStateNormal];
    [self setTitle:@"" forState:UIControlStateSelected];
    self.titleLabel.font = [UIFont systemFontOfSize:12];
    //py
  //  [self.titleLabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:8]];
    [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [self setTitleColor:[UIColor blackColor] forState:UIControlStateSelected];
    self.adjustsImageWhenHighlighted = NO;
    [self setImage:[UIImage imageNamed:@"下拉箭头"] forState:UIControlStateNormal];
    [self setImage:[UIImage imageNamed:@"收回箭头"] forState:UIControlStateSelected];
    self.titleEdgeInsets = UIEdgeInsetsMake(0, -self.imageView.frame.size.width-kImageToTextMargin, 0, self.imageView.frame.size.width);
    self.imageEdgeInsets = UIEdgeInsetsMake(0, self.titleLabel.frame.size.width, 0, -self.titleLabel.frame.size.width);
    return self;

}
-(void)setHighlighted:(BOOL)highlighted {}

@end
